#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 1000000000

const unsigned int A = 1664525, C = 1013904223;

unsigned int next(unsigned int x) {
  return x*A+C;
}

int main() {
  unsigned int r = time(NULL);
  double x, y;
  int i, dots_inside_circle;
  for (i=0; i<N; i++) {
    r = next(r);
    x = (r%1000)/1000.0;        
    r = next(r);
    y = (r%1000)/1000.0;        
    if ( x*x + y*y < 1.0 )
      dots_inside_circle++;
  }
  printf("%.6lf\n", 4.0*(1.0*dots_inside_circle/N));
  return 0;  
}
